<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBannerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('banner', function (Blueprint $table) {
            $table->id();
            $table->json('img_url')->comment('图片地址');
            $table->tinyInteger('type')->comment('类型1=首页2=学堂3=金刚区4其他');
            $table->tinyInteger('mold')->nullable()->comment('跳转类型1店铺 2资讯 3外链');

            $table->string('redirect_url')->nullable()->comment('跳转地址');
            $table->unsignedInteger('store_id')->nullable()->comment('店铺id');
            $table->unsignedInteger('news_id')->nullable()->comment('资讯id');
            $table->tinyInteger('status')->comment('状态0下线1上线');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('banner');
    }
}
